﻿<UserControl x:Class="ACPLogAnalyzer.GraphUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:DV="clr-namespace:System.Windows.Controls.DataVisualization.VisualStudio.Design;assembly=System.Windows.Controls.DataVisualization.Toolkit.VisualStudio.Design"
             xmlns:DVC="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"       
             xmlns:VIZ="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit"
             Height="339" 
             Width="406"              
             mc:Ignorable="d" 
             d:DesignHeight="457" d:DesignWidth="523">
    
    <Grid ToolTip="Right-click for graph options" ContextMenuOpening="Grid_ContextMenuOpening">
        <Grid.ContextMenu>
            <ContextMenu Name="contextMenuGrid">
                <MenuItem Header="Export Data to Excel" Click="MenuItemExportExcel_Click" />
                <MenuItem Header="Export Data to CSV" Click="MenuItemExportCSV_Click" />
                <MenuItem Header="Hide Average" Click="MenuItemShowHideAverage_Click" Name="ctxMenuShowHideAvg" />
                <MenuItem Header="Hide Tertiary" Click="MenuItemShowHideTertiary_Click" Name="ctxMenuShowHideTertiary" />
                <MenuItem Header="Cancel" />
            </ContextMenu>
        </Grid.ContextMenu>
        
        <TextBlock Name="GraphTitle" Text="Data Plot Title" VerticalAlignment="Top" TextAlignment="Center" FontSize="16" Height="63" Panel.ZIndex="99" Margin="12,1,12,0" ToolTip="Right-click for graph options" />

        <DVC:Chart Canvas.Top="80" 
                   Title="" 
                   Canvas.Left="10" 
                   Name="lineGraph"
                   Background="Transparent" 
                   Margin="1,0,0,0" 
                   BorderBrush="White" 
                   FontSize="16" 
                   BorderThickness="0" 
                   ToolTip="Right-click for graph options">

            <DVC:Chart.Axes>
                <DVC:CategoryAxis Name="yAxis" Orientation="Y" Title="y-axis" />
                <DVC:CategoryAxis Name="xAxis" Orientation="X" Title="x-axis" />
            </DVC:Chart.Axes>

            <DVC:Chart.Series>
                <DVC:LineSeries Name="lineSeries" 
                                MouseUp="lineSeries1MouseUp"                           
                                Title="Primary"   
                                IndependentValueBinding="{Binding Path=Key}" 
                                DependentValueBinding="{Binding Path=Value}" 
                                Background="Transparent" 
                                Visibility="Visible">
                </DVC:LineSeries>

                <DVC:LineSeries Name="lineSeries2" 
                                Title="Secondary"                              
                                IndependentValueBinding="{Binding Path=Key}" 
                                DependentValueBinding="{Binding Path=Value}" 
                                Background="Transparent" 
                                Visibility="Visible">
                </DVC:LineSeries>

                <DVC:LineSeries Name="lineSeries3" 
                                MouseUp="lineSeries3MouseUp"
                                Title="Tertiary"    
                                IndependentValueBinding="{Binding Path=Key}" 
                                DependentValueBinding="{Binding Path=Value}" 
                                Background="Transparent" 
                                Visibility="Visible">
                    <DVC:LineSeries.IndependentAxis>
                        <DVC:CategoryAxis Name="xAxisTertiary" Orientation="X" Title="x-axis (tertiary)" />
                    </DVC:LineSeries.IndependentAxis>
                </DVC:LineSeries>
            </DVC:Chart.Series>
        </DVC:Chart>
    </Grid>
</UserControl>
